package com.zheng.damo01.作业;

public class Test12 {
    public static void main(String[] args) {
        String str = "1.hello2.world3.java4.string";
        int end=str.indexOf(".");
        int starts=end+1;
        while (true){
            if (end==-1){
                break;
            }
            end=str.indexOf(".",starts+1);
            if (end==-1){
                System.out.println(str.substring(starts));
            }else {
                System.out.println(str.substring(starts, end-1));
            }
            starts=end+1;
        }
    }
}
